using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Webbshop
{
    /// <summary>
    /// Summary description for BasePage
    /// </summary>
    public class BasePage : System.Web.UI.Page
    {
        protected override void InitializeCulture()
        {
            HttpCookie cultureCookie = Request.Cookies["Culture"];

            //Because of reload (Response.Redirect) Request.Form will not have any values, Check if there is
            //a cookie first
            string cultureCode = (cultureCookie != null) ? cultureCookie.Value : null;
            if (!string.IsNullOrEmpty(cultureCode))
            {
                this.UICulture = cultureCode;
                this.Culture = cultureCode;
                System.Globalization.CultureInfo culture = System.Globalization.CultureInfo.CreateSpecificCulture(cultureCode);
                System.Threading.Thread.CurrentThread.CurrentCulture = culture;
                System.Threading.Thread.CurrentThread.CurrentUICulture = culture;
            }
            base.InitializeCulture();
        }

    }
}